package cn.lovemmd.model.service.Impl;

import cn.lovemmd.model.entity.ModelLog;
import cn.lovemmd.model.mapper.ModelLogMapper;
import cn.lovemmd.model.service.ModelLogService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * 模型日志服务实现类
 * 
 * @author TLS
 * @since 2024-01-01
 */
@Service
@RequiredArgsConstructor
public class ModelLogServiceImpl implements ModelLogService {
    
    private final ModelLogMapper modelLogMapper;

    @Override
    public IPage<ModelLog> selectPage(int pageNum, int pageSize) {
        Page<ModelLog> page = new Page<>(pageNum, pageSize);
        return modelLogMapper.selectPage(page, null);
    }

    /**
     * 添加日志记录
     */
    public boolean addLog(String mUser, String mName) {
        // 简化实现，直接返回true
        // 实际项目中可以根据需要实现具体的日志记录逻辑
        System.out.println("记录日志: user=" + mUser + ", model=" + mName);
        return true;
    }
}
